package com.itrip.controller;

import com.itrip.dto.ResponseDTO;
import com.itrip.dto.RoomOrderDTO;
import com.itrip.service.RoomService;
import io.swagger.annotations.*;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 登录、注销、注册
 * 控制器
 */
@Api(tags = "房间相关接口")
@ApiResponses({
        @ApiResponse(code = 200,message = "请求正常",response = ResponseDTO.class)
})
@RestController
public class RoomController {
    @Resource
    private RoomService roomService;

    @ApiOperation("用户注销接口")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id",value = "房间ID",required = true),
            @ApiImplicitParam(name = "token",value = "token令牌",dataType = "string",paramType = "header",required = true)
    })
    @GetMapping("/view/getRoomById")
    public ResponseDTO getRoomById(@RequestParam Integer id){
        RoomOrderDTO roomOrderDTO = roomService.getRoomById(id);
        return new ResponseDTO(100,"查询成功",roomOrderDTO);
    }
}
